
var exec = require('child_process').exec;

exports.pull = function(req, res) {
  var child = exec('git pull --rebase origin master', {
        encoding: 'utf8',
        timeout: 0,
        maxBuffer: 200*1024,
        killSignal: 'SIGTERM',
        cwd: 'd:/code/puller',
        env: null
      },
    function(error, stdout, stderr)  {
      console.log('error', error);
      console.log("stdout: ", stdout);
      console.log("stderr: ", stderr);
      if (error !== null) {
        console.log("exec error", error);
      }
  });
  res.send("ok");
}
